<template>
   <div class="address">
         <header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">收货地址</h1>
		</header>
         <div class="YourPosition">
       <div class="wangxiaoer">
           <div class="wang1">王小二 <span>15060950558</span></div>
           <div>福建省厦门市思明区软件园二期37号</div>
       </div>
    </div>
        <ul class="mui-table-view">
    <li class="mui-table-view-cell">
        <img :src="state" alt="" @click="state1">
        设为默认
        <img  class="f_right" src="../../../img/purchase/删除.png" @click="remov">
        <img class="f_right m_r10" src="../../../img/purchase/修改.png" alt="">
    </li>
        </ul>
        <div class="padding" >
     <mt-button size="large" type="danger" @click="purchase">添加新地址</mt-button> 
     </div>
   </div>
</template>
<script>
import { MessageBox } from 'mint-ui';
export default {
  data() {
    return { state:"",is:1 , 
    };
  },
  created() {
       this.state1();
  
  },
  methods:{
      remov:function(){
        MessageBox.confirm('', {
                message: '是否删除收货地址',
                title: '提示',
                confirmButtonText: '确定',
                cancelButtonText: '取消'
            }).then(action => {
                if (action == 'confirm') {
                    console.log('abc');
                }
            }).catch(err => {
                if (err == 'cancel') {
                    console.log('123');
                }
            });       
      },
      state1:function(){
          if(this.is){
              this.state=require('../../../img/purchase/设为默认选中.png');
              this.is=0
          }else{
              this.state=require('../../../img/purchase/设为默认未选中.png');
             this.is=1
          }
      },
      purchase:function(){
          this.$router.push({ name: "NewAddress"});}
      
  },
 
};
</script>
<style lang="scss" scoped>
 .address{
     background: #e0e0e0;
       padding-top:40px;
  .mui-bar {
    background: rgb(153, 9, 9);
       a{ color:#ffff;}
   h1{ color:#ffff;}
  }
  
     .YourPosition{
      background:#fff;
         padding:20px 0; 
          margin:10px 20px 0;
     ; 
        border-bottom: 1px solid #e0e0e0;
      .wangxiaoer{
           padding:0 10px; 
          display:inline-block;
          .wang1{
              padding-bottom:10px;
          }
      }
  }
    .mui-table-view:after{
            height:0px;
        }
  .mui-table-view{
        margin:0px 20px ;
        .mui-table-view-cell{
             padding: 0px 15px;
             padding-bottom:0px; 
             line-height: 29px;
             img{
                 height: 24px;
                position: relative;
                top:6px;
             }
        }
         
  }
    .padding{
         padding:30px 20px;
           background: #e0e0e0;
    }
    .mask{
    
    }
 }
</style>    
